

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>监控集群 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="监控 OSD 和归置组" href="../monitoring-osd-pg/" />
    <link rel="prev" title="健康检查" href="../health-checks/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../">Ceph 存储集群</a></li>
          <li class="breadcrumb-item"><a href="../">集群运维</a></li>
      <li class="breadcrumb-item active">监控集群</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/rados/operations/monitoring.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../configuration/">配置</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">运维</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../operating/">操纵集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../health-checks/">健康检查</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">监控集群</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">使用命令行</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">检查集群的状态</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">观察集群</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">监控健康检查信息</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id10">检查集群的使用情况</a></li>
<li class="toctree-l4"><a class="reference internal" href="#osd">检查 OSD 状态</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id11">检查监视器状态</a></li>
<li class="toctree-l4"><a class="reference internal" href="#mds">检查 MDS 状态</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id12">检查归置组状态</a></li>
<li class="toctree-l4"><a class="reference internal" href="#rados-monitoring-using-admin-socket">使用管理套接字</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../monitoring-osd-pg/">监控 OSD 和归置组</a></li>
<li class="toctree-l3"><a class="reference internal" href="../user-management/">用户管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pgcalc/">PG Calc</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-placement/">数据归置概览</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pools/">存储池</a></li>
<li class="toctree-l3"><a class="reference internal" href="../erasure-code/">纠删码</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cache-tiering/">分级缓存</a></li>
<li class="toctree-l3"><a class="reference internal" href="../placement-groups/">归置组</a></li>
<li class="toctree-l3"><a class="reference internal" href="../upmap/">使用 pg-upmap</a></li>
<li class="toctree-l3"><a class="reference internal" href="../read-balancer/">Operating the Read (Primary) Balancer</a></li>
<li class="toctree-l3"><a class="reference internal" href="../balancer/">均衡器模块</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crush-map/">CRUSH 图</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crush-map-edits/">手动编辑一个 CRUSH 图</a></li>
<li class="toctree-l3"><a class="reference internal" href="../stretch-mode/">Stretch Clusters</a></li>
<li class="toctree-l3"><a class="reference internal" href="../change-mon-elections/">Configuring Monitor Election Strategies</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-or-rm-osds/">增加/删除 OSD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-or-rm-mons/">增加/删除监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../devices/">设备管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bluestore-migration/">迁移到 BlueStore</a></li>
<li class="toctree-l3"><a class="reference internal" href="../control/">命令参考</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/community/">Ceph 社区</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-mon/">监视器故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-osd/">OSD 故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-pg/">归置组排障</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/log-and-debug/">日志记录和调试</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/cpu-profiling/">CPU 剖析</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/memory-profiling/">内存剖析</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">    手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="id1">
<h1>监控集群<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h1>
<p>集群运行起来后，你可以用 <code class="docutils literal notranslate"><span class="pre">ceph</span></code> 工具来监控，典型的监控包括检查 OSD 状态、监视器状态、归置组状态和元数据服务器状态。</p>
<section id="id2">
<h2>使用命令行<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<section id="id3">
<h3>交互模式<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h3>
<p>要在交互模式下运行 <code class="docutils literal notranslate"><span class="pre">ceph</span></code> ，不要带参数运行 <code class="docutils literal notranslate"><span class="pre">ceph</span></code> ，例如：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "$ ";
}
</style><span class="prompt1">ceph</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt2:before {
  content: "ceph> ";
}
</style><span class="prompt2">health</span>
<span class="prompt2">status</span>
<span class="prompt2">quorum_status</span>
<span class="prompt2">mon stat</span>
</pre></div></div></section>
<section id="id4">
<h3>非默认的路径<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h3>
<p>如果你的配置文件或密钥环不在默认位置内，可以手动给 <code class="docutils literal notranslate"><span class="pre">ceph</span></code> 工具指定其位置，
执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>-c<span class="w"> </span>/path/to/conf<span class="w"> </span>-k<span class="w"> </span>/path/to/keyring<span class="w"> </span>health</span>
</pre></div></div></section>
</section>
<section id="id5">
<h2>检查集群的状态<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h2>
<p>启动集群后、读写数据前，先检查下集群的健康状态。</p>
<p>可以用下面的命令检查集群状态：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>status</span>
</pre></div></div><p>另外，可以执行命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>-s</span>
</pre></div></div><p>在交互模式下，输入 <code class="docutils literal notranslate"><span class="pre">status</span></code> 再按回车 <strong>Enter</strong> 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt2">status</span>
</pre></div></div><p>Ceph 就会打印出集群状态。例如，一个小型的演示集群，
各种服务都有一个例程（监视器、管理器、 OSD ），可能会打印如下的：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cluster</span><span class="p">:</span>
  <span class="nb">id</span><span class="p">:</span>     <span class="mf">477e46</span><span class="n">f1</span><span class="o">-</span><span class="n">ae41</span><span class="o">-</span><span class="mf">4e43</span><span class="o">-</span><span class="mi">9</span><span class="n">c8f</span><span class="o">-</span><span class="mi">72</span><span class="n">c918ab0a20</span>
  <span class="n">health</span><span class="p">:</span> <span class="n">HEALTH_OK</span>

<span class="n">services</span><span class="p">:</span>
  <span class="n">mon</span><span class="p">:</span> <span class="mi">3</span> <span class="n">daemons</span><span class="p">,</span> <span class="n">quorum</span> <span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">c</span>
  <span class="n">mgr</span><span class="p">:</span> <span class="n">x</span><span class="p">(</span><span class="n">active</span><span class="p">)</span>
  <span class="n">mds</span><span class="p">:</span> <span class="n">cephfs_a</span><span class="o">-</span><span class="mi">1</span><span class="o">/</span><span class="mi">1</span><span class="o">/</span><span class="mi">1</span> <span class="n">up</span>  <span class="p">{</span><span class="mi">0</span><span class="o">=</span><span class="n">a</span><span class="o">=</span><span class="n">up</span><span class="p">:</span><span class="n">active</span><span class="p">},</span> <span class="mi">2</span> <span class="n">up</span><span class="p">:</span><span class="n">standby</span>
  <span class="n">osd</span><span class="p">:</span> <span class="mi">3</span> <span class="n">osds</span><span class="p">:</span> <span class="mi">3</span> <span class="n">up</span><span class="p">,</span> <span class="mi">3</span> <span class="ow">in</span>

<span class="n">data</span><span class="p">:</span>
  <span class="n">pools</span><span class="p">:</span>   <span class="mi">2</span> <span class="n">pools</span><span class="p">,</span> <span class="mi">16</span> <span class="n">pgs</span>
  <span class="n">objects</span><span class="p">:</span> <span class="mi">21</span> <span class="n">objects</span><span class="p">,</span> <span class="mf">2.19</span><span class="n">K</span>
  <span class="n">usage</span><span class="p">:</span>   <span class="mi">546</span> <span class="n">GB</span> <span class="n">used</span><span class="p">,</span> <span class="mi">384</span> <span class="n">GB</span> <span class="o">/</span> <span class="mi">931</span> <span class="n">GB</span> <span class="n">avail</span>
  <span class="n">pgs</span><span class="p">:</span>     <span class="mi">16</span> <span class="n">active</span><span class="o">+</span><span class="n">clean</span>
</pre></div>
</div>
<section id="ceph">
<h3>Ceph 如何计算数据量<a class="headerlink" href="#ceph" title="Permalink to this heading"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">usage</span></code> 值反映了<em>事实上</em>已占用的原始存储空间。
<code class="docutils literal notranslate"><span class="pre">xxx</span> <span class="pre">GB</span> <span class="pre">/</span> <span class="pre">xxx</span> <span class="pre">GB</span></code> 值则是剩余空间（较小的数）与集群总容量的比较。理论数值反映了所存储数据的原始尺寸，未计算其副本、克隆、或快照空间，所以数据存储实际占用的空间通常会超过理论数值，因为 Ceph 会自动创建数据副本，另外存储空间也可能用于克隆和快照。</p>
</section>
</section>
<section id="id6">
<h2>观察集群<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h2>
<p>除了各守护进程的本地日志， Ceph 集群还维护着一个 <em>集群日志</em>，
它记录着事关整个系统的高级事件。此类日志记录在监视器服务器的磁盘上（默认为 <code class="docutils literal notranslate"><span class="pre">/var/log/ceph/ceph.log</span></code> ），也可以通过命令行监控。</p>
<p>要持续关注集群日志，用下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>-w</span>
</pre></div></div><p>Ceph 会打印系统的状态，然后是正发生着的各日子消息。例如：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cluster</span><span class="p">:</span>
  <span class="nb">id</span><span class="p">:</span>     <span class="mf">477e46</span><span class="n">f1</span><span class="o">-</span><span class="n">ae41</span><span class="o">-</span><span class="mf">4e43</span><span class="o">-</span><span class="mi">9</span><span class="n">c8f</span><span class="o">-</span><span class="mi">72</span><span class="n">c918ab0a20</span>
  <span class="n">health</span><span class="p">:</span> <span class="n">HEALTH_OK</span>

<span class="n">services</span><span class="p">:</span>
  <span class="n">mon</span><span class="p">:</span> <span class="mi">3</span> <span class="n">daemons</span><span class="p">,</span> <span class="n">quorum</span> <span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">c</span>
  <span class="n">mgr</span><span class="p">:</span> <span class="n">x</span><span class="p">(</span><span class="n">active</span><span class="p">)</span>
  <span class="n">mds</span><span class="p">:</span> <span class="n">cephfs_a</span><span class="o">-</span><span class="mi">1</span><span class="o">/</span><span class="mi">1</span><span class="o">/</span><span class="mi">1</span> <span class="n">up</span>  <span class="p">{</span><span class="mi">0</span><span class="o">=</span><span class="n">a</span><span class="o">=</span><span class="n">up</span><span class="p">:</span><span class="n">active</span><span class="p">},</span> <span class="mi">2</span> <span class="n">up</span><span class="p">:</span><span class="n">standby</span>
  <span class="n">osd</span><span class="p">:</span> <span class="mi">3</span> <span class="n">osds</span><span class="p">:</span> <span class="mi">3</span> <span class="n">up</span><span class="p">,</span> <span class="mi">3</span> <span class="ow">in</span>

<span class="n">data</span><span class="p">:</span>
  <span class="n">pools</span><span class="p">:</span>   <span class="mi">2</span> <span class="n">pools</span><span class="p">,</span> <span class="mi">16</span> <span class="n">pgs</span>
  <span class="n">objects</span><span class="p">:</span> <span class="mi">21</span> <span class="n">objects</span><span class="p">,</span> <span class="mf">2.19</span><span class="n">K</span>
  <span class="n">usage</span><span class="p">:</span>   <span class="mi">546</span> <span class="n">GB</span> <span class="n">used</span><span class="p">,</span> <span class="mi">384</span> <span class="n">GB</span> <span class="o">/</span> <span class="mi">931</span> <span class="n">GB</span> <span class="n">avail</span>
  <span class="n">pgs</span><span class="p">:</span>     <span class="mi">16</span> <span class="n">active</span><span class="o">+</span><span class="n">clean</span>


<span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">24</span> <span class="mi">08</span><span class="p">:</span><span class="mi">15</span><span class="p">:</span><span class="mf">11.329298</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">23</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">INF</span><span class="p">]</span> <span class="n">osd</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6806</span><span class="o">/</span><span class="mi">20527</span> <span class="n">boot</span>
<span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">24</span> <span class="mi">08</span><span class="p">:</span><span class="mi">15</span><span class="p">:</span><span class="mf">14.258143</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">39</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">INF</span><span class="p">]</span> <span class="n">Activating</span> <span class="n">manager</span> <span class="n">daemon</span> <span class="n">x</span>
<span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">24</span> <span class="mi">08</span><span class="p">:</span><span class="mi">15</span><span class="p">:</span><span class="mf">15.446025</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">47</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">INF</span><span class="p">]</span> <span class="n">Manager</span> <span class="n">daemon</span> <span class="n">x</span> <span class="ow">is</span> <span class="n">now</span> <span class="n">available</span>
</pre></div>
</div>
<p>除了用 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">-w</span></code> 打印它们发出的日志行，还可以用
<code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">log</span> <span class="pre">last</span> <span class="pre">[n]</span></code> 查看最近的 <code class="docutils literal notranslate"><span class="pre">n</span></code> 行集群日志。</p>
</section>
<section id="id7">
<h2>监控健康检查信息<a class="headerlink" href="#id7" title="Permalink to this heading"></a></h2>
<p>Ceph 不间断地对自身状态做<em>健康检查</em>。查到问题时，
会在 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">status</span></code> （或 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">health</span></code> ）的输出中反映出来。另外，检查失败时、或集群恢复时，相关消息也会发往集群日志。</p>
<p>例如，一个 OSD 挂掉时，状态输出的 <code class="docutils literal notranslate"><span class="pre">health</span></code> 那段可能会更新为如下：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">health</span><span class="p">:</span> <span class="n">HEALTH_WARN</span>
        <span class="mi">1</span> <span class="n">osds</span> <span class="n">down</span>
        <span class="n">Degraded</span> <span class="n">data</span> <span class="n">redundancy</span><span class="p">:</span> <span class="mi">21</span><span class="o">/</span><span class="mi">63</span> <span class="n">objects</span> <span class="n">degraded</span> <span class="p">(</span><span class="mf">33.333</span><span class="o">%</span><span class="p">),</span> <span class="mi">16</span> <span class="n">pgs</span> <span class="n">unclean</span><span class="p">,</span> <span class="mi">16</span> <span class="n">pgs</span> <span class="n">degraded</span>
</pre></div>
</div>
<p>此时，也发送了集群日志消息，以记录此次健康检查失败事件：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">25</span> <span class="mi">10</span><span class="p">:</span><span class="mi">08</span><span class="p">:</span><span class="mf">58.265945</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">91</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">WRN</span><span class="p">]</span> <span class="n">Health</span> <span class="n">check</span> <span class="n">failed</span><span class="p">:</span> <span class="mi">1</span> <span class="n">osds</span> <span class="n">down</span> <span class="p">(</span><span class="n">OSD_DOWN</span><span class="p">)</span>
<span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">25</span> <span class="mi">10</span><span class="p">:</span><span class="mi">09</span><span class="p">:</span><span class="mf">01.302624</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">94</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">WRN</span><span class="p">]</span> <span class="n">Health</span> <span class="n">check</span> <span class="n">failed</span><span class="p">:</span> <span class="n">Degraded</span> <span class="n">data</span> <span class="n">redundancy</span><span class="p">:</span> <span class="mi">21</span><span class="o">/</span><span class="mi">63</span> <span class="n">objects</span> <span class="n">degraded</span> <span class="p">(</span><span class="mf">33.333</span><span class="o">%</span><span class="p">),</span> <span class="mi">16</span> <span class="n">pgs</span> <span class="n">unclean</span><span class="p">,</span> <span class="mi">16</span> <span class="n">pgs</span> <span class="n">degraded</span> <span class="p">(</span><span class="n">PG_DEGRADED</span><span class="p">)</span>
</pre></div>
</div>
<p>当这个 OSD 恢复在线时，集群日志也会记录集群已回归健康状态：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">25</span> <span class="mi">10</span><span class="p">:</span><span class="mi">11</span><span class="p">:</span><span class="mf">11.526841</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">109</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">WRN</span><span class="p">]</span> <span class="n">Health</span> <span class="n">check</span> <span class="n">update</span><span class="p">:</span> <span class="n">Degraded</span> <span class="n">data</span> <span class="n">redundancy</span><span class="p">:</span> <span class="mi">2</span> <span class="n">pgs</span> <span class="n">unclean</span><span class="p">,</span> <span class="mi">2</span> <span class="n">pgs</span> <span class="n">degraded</span><span class="p">,</span> <span class="mi">2</span> <span class="n">pgs</span> <span class="n">undersized</span> <span class="p">(</span><span class="n">PG_DEGRADED</span><span class="p">)</span>
<span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">25</span> <span class="mi">10</span><span class="p">:</span><span class="mi">11</span><span class="p">:</span><span class="mf">13.535493</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">110</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">INF</span><span class="p">]</span> <span class="n">Health</span> <span class="n">check</span> <span class="n">cleared</span><span class="p">:</span> <span class="n">PG_DEGRADED</span> <span class="p">(</span><span class="n">was</span><span class="p">:</span> <span class="n">Degraded</span> <span class="n">data</span> <span class="n">redundancy</span><span class="p">:</span> <span class="mi">2</span> <span class="n">pgs</span> <span class="n">unclean</span><span class="p">,</span> <span class="mi">2</span> <span class="n">pgs</span> <span class="n">degraded</span><span class="p">,</span> <span class="mi">2</span> <span class="n">pgs</span> <span class="n">undersized</span><span class="p">)</span>
<span class="mi">2017</span><span class="o">-</span><span class="mi">07</span><span class="o">-</span><span class="mi">25</span> <span class="mi">10</span><span class="p">:</span><span class="mi">11</span><span class="p">:</span><span class="mf">13.535577</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span> <span class="n">mon</span><span class="mf">.0</span> <span class="mf">172.21.9.34</span><span class="p">:</span><span class="mi">6789</span><span class="o">/</span><span class="mi">0</span> <span class="mi">111</span> <span class="p">:</span> <span class="n">cluster</span> <span class="p">[</span><span class="n">INF</span><span class="p">]</span> <span class="n">Cluster</span> <span class="ow">is</span> <span class="n">now</span> <span class="n">healthy</span>
</pre></div>
</div>
<section id="id8">
<h3>网络性能检查<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h3>
<p>Ceph OSD 会相互发送心跳 ping 消息，
以监视守护进程的可用性和网络性能。
如果只是探测到了单次延迟的响应，这表明可能仅仅是 OSD 很忙碌。
但是如果在不同 OSD 对之间都探测到了多次延迟，
这表明可能是网络交换机故障、 NIC 故障、或者一个底层故障。</p>
<p>默认情况下，超过 1 秒（ 1000 毫秒）的心跳时间会产生一个健康检查，
一个 <code class="docutils literal notranslate"><span class="pre">HEALTH_WARN</span></code> 。例如：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">HEALTH_WARN</span> <span class="n">Slow</span> <span class="n">OSD</span> <span class="n">heartbeats</span> <span class="n">on</span> <span class="n">back</span> <span class="p">(</span><span class="n">longest</span> <span class="mf">1118.001</span><span class="n">ms</span><span class="p">)</span>
</pre></div>
</div>
<p>在 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">health</span> <span class="pre">detail</span></code> 命令的输出中，您可以看到哪些 OSD 出现了延迟以及延迟时间有多长。
<code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">health</span> <span class="pre">detail</span></code> 的输出限制为 10 行。
下面是 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">health</span> <span class="pre">detail</span></code> 命令的输出示例：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">WRN</span><span class="p">]</span> <span class="n">OSD_SLOW_PING_TIME_BACK</span><span class="p">:</span> <span class="n">Slow</span> <span class="n">OSD</span> <span class="n">heartbeats</span> <span class="n">on</span> <span class="n">back</span> <span class="p">(</span><span class="n">longest</span> <span class="mf">1118.001</span><span class="n">ms</span><span class="p">)</span>
    <span class="n">Slow</span> <span class="n">OSD</span> <span class="n">heartbeats</span> <span class="n">on</span> <span class="n">back</span> <span class="kn">from</span> <span class="nn">osd.</span><span class="mi">0</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack1</span><span class="p">]</span> <span class="n">to</span> <span class="n">osd</span><span class="mf">.1</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack1</span><span class="p">]</span> <span class="mf">1118.001</span> <span class="n">msec</span> <span class="n">possibly</span> <span class="n">improving</span>
    <span class="n">Slow</span> <span class="n">OSD</span> <span class="n">heartbeats</span> <span class="n">on</span> <span class="n">back</span> <span class="kn">from</span> <span class="nn">osd.</span><span class="mi">0</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack1</span><span class="p">]</span> <span class="n">to</span> <span class="n">osd</span><span class="mf">.2</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack2</span><span class="p">]</span> <span class="mf">1030.123</span> <span class="n">msec</span>
    <span class="n">Slow</span> <span class="n">OSD</span> <span class="n">heartbeats</span> <span class="n">on</span> <span class="n">back</span> <span class="kn">from</span> <span class="nn">osd.</span><span class="mi">2</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack2</span><span class="p">]</span> <span class="n">to</span> <span class="n">osd</span><span class="mf">.1</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack1</span><span class="p">]</span> <span class="mf">1015.321</span> <span class="n">msec</span>
    <span class="n">Slow</span> <span class="n">OSD</span> <span class="n">heartbeats</span> <span class="n">on</span> <span class="n">back</span> <span class="kn">from</span> <span class="nn">osd.</span><span class="mi">1</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack1</span><span class="p">]</span> <span class="n">to</span> <span class="n">osd</span><span class="mf">.0</span> <span class="p">[</span><span class="n">dc1</span><span class="p">,</span><span class="n">rack1</span><span class="p">]</span> <span class="mf">1010.456</span> <span class="n">msec</span>
</pre></div>
</div>
<p>要查看更多细节并收集完整的网络性能信息转储，
用 <code class="docutils literal notranslate"><span class="pre">dump_osd_network</span></code> 命令。
该命令通常发送到 Ceph 管理器守护进程，
但也可用于收集特定 OSD 的交互信息，方法是将其发送到这个 OSD 。
慢心跳的默认阈值是 1 秒（ 1000 毫秒），
但可以用毫秒数作为参数来覆盖该阈值。</p>
<p>要显示指定阈值为 0 的所有网络性能数据，向 mgr 发送以下命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>daemon<span class="w"> </span>/var/run/ceph/ceph-mgr.x.asok<span class="w"> </span>dump_osd_network<span class="w"> </span><span class="m">0</span></span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="s2">&quot;threshold&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
    <span class="s2">&quot;entries&quot;</span><span class="p">:</span> <span class="p">[</span>
        <span class="p">{</span>
            <span class="s2">&quot;last update&quot;</span><span class="p">:</span> <span class="s2">&quot;Wed Sep  4 17:04:49 2019&quot;</span><span class="p">,</span>
            <span class="s2">&quot;stale&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
            <span class="s2">&quot;from osd&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;to osd&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;interface&quot;</span><span class="p">:</span> <span class="s2">&quot;front&quot;</span><span class="p">,</span>
            <span class="s2">&quot;average&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">1.023</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">0.860</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">0.883</span>
            <span class="p">},</span>
            <span class="s2">&quot;min&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">0.818</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">0.607</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">0.607</span>
            <span class="p">},</span>
            <span class="s2">&quot;max&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">1.164</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">1.173</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">1.544</span>
            <span class="p">},</span>
            <span class="s2">&quot;last&quot;</span><span class="p">:</span> <span class="mf">0.924</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="s2">&quot;last update&quot;</span><span class="p">:</span> <span class="s2">&quot;Wed Sep  4 17:04:49 2019&quot;</span><span class="p">,</span>
            <span class="s2">&quot;stale&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
            <span class="s2">&quot;from osd&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;to osd&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;interface&quot;</span><span class="p">:</span> <span class="s2">&quot;back&quot;</span><span class="p">,</span>
            <span class="s2">&quot;average&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">0.968</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">0.897</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">0.830</span>
            <span class="p">},</span>
            <span class="s2">&quot;min&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">0.860</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">0.563</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">0.502</span>
            <span class="p">},</span>
            <span class="s2">&quot;max&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">1.171</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">1.216</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">1.456</span>
            <span class="p">},</span>
            <span class="s2">&quot;last&quot;</span><span class="p">:</span> <span class="mf">0.845</span>
        <span class="p">},</span>
        <span class="p">{</span>
            <span class="s2">&quot;last update&quot;</span><span class="p">:</span> <span class="s2">&quot;Wed Sep  4 17:04:48 2019&quot;</span><span class="p">,</span>
            <span class="s2">&quot;stale&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
            <span class="s2">&quot;from osd&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
            <span class="s2">&quot;to osd&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;interface&quot;</span><span class="p">:</span> <span class="s2">&quot;front&quot;</span><span class="p">,</span>
            <span class="s2">&quot;average&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">0.965</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">0.811</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">0.850</span>
            <span class="p">},</span>
            <span class="s2">&quot;min&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">0.650</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">0.488</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">0.466</span>
            <span class="p">},</span>
            <span class="s2">&quot;max&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;1min&quot;</span><span class="p">:</span> <span class="mf">1.252</span><span class="p">,</span>
                <span class="s2">&quot;5min&quot;</span><span class="p">:</span> <span class="mf">1.252</span><span class="p">,</span>
                <span class="s2">&quot;15min&quot;</span><span class="p">:</span> <span class="mf">1.362</span>
            <span class="p">},</span>
        <span class="s2">&quot;last&quot;</span><span class="p">:</span> <span class="mf">0.791</span>
    <span class="p">},</span>
    <span class="o">...</span>
</pre></div>
</div>
</section>
<section id="id9">
<h3>屏蔽健康检查<a class="headerlink" href="#id9" title="Permalink to this heading"></a></h3>
<p>健康检查可以屏蔽掉（ mute ），这样就不会影响集群的整体报告状态。
例如，如果集群产生了单个健康检查，然后您将该健康检查屏蔽掉，
那么集群将报告 <code class="docutils literal notranslate"><span class="pre">HEALTH_OK</span></code> 状态。要屏蔽特定的健康检查，
用与这个健康检查相对应的健康检查代码（请参阅 <a class="reference internal" href="../health-checks/#health-checks"><span class="std std-ref">健康检查</span></a> ），
并执行以下命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>mute<span class="w"> </span>&lt;code&gt;</span>
</pre></div></div><p>例如，要屏蔽 <code class="docutils literal notranslate"><span class="pre">OSD_DOWN</span></code> 健康检查，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>mute<span class="w"> </span>OSD_DOWN</span>
</pre></div></div><p>屏蔽掉的也会展示在 ceph 健康检查命令的简报、和详情输出里。
例如，在上述场景下，集群将报告：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">HEALTH_OK</span> <span class="p">(</span><span class="n">muted</span><span class="p">:</span> <span class="n">OSD_DOWN</span><span class="p">)</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>detail</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">HEALTH_OK</span> <span class="p">(</span><span class="n">muted</span><span class="p">:</span> <span class="n">OSD_DOWN</span><span class="p">)</span>
<span class="p">(</span><span class="n">MUTED</span><span class="p">)</span> <span class="n">OSD_DOWN</span> <span class="mi">1</span> <span class="n">osds</span> <span class="n">down</span>
    <span class="n">osd</span><span class="mf">.1</span> <span class="ow">is</span> <span class="n">down</span>
</pre></div>
</div>
<p>取消屏蔽，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>unmute<span class="w"> </span>&lt;code&gt;</span>
</pre></div></div><p>例如：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>unmute<span class="w"> </span>OSD_DOWN</span>
</pre></div></div><p>“health mute” （健康消息屏蔽）可以设置一个 TTL
（生存时间， <strong>T</strong>ime <strong>T</strong>o <strong>L</strong>ive ）：
这意味着屏蔽将在指定时间后自动失效。
TTL 是可选的时间段参数，如下所示：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>mute<span class="w"> </span>OSD_DOWN<span class="w"> </span>4h<span class="w">    </span><span class="c1"># mute for 4 hours</span></span>
<span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>mute<span class="w"> </span>MON_DOWN<span class="w"> </span>15m<span class="w">   </span><span class="c1"># mute for 15 minutes</span></span>
</pre></div></div><p>通常情况下，如果之前屏蔽掉的健康检查已解决（例如，
在上述示例中引发 <code class="docutils literal notranslate"><span class="pre">OSD_DOWN</span></code> 健康检查的 OSD 已恢复正常），屏蔽就会失效。
如果同样的健康检查之后再次出现，还会以常规方式报告。</p>
<p>可以将健康静音设置为 sticky （有粘性）：意思是即使健康检查已经清除，屏蔽依然保持。
例如，要让健康静音成为“粘性”屏蔽，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>health<span class="w"> </span>mute<span class="w"> </span>OSD_DOWN<span class="w"> </span>1h<span class="w"> </span>--sticky<span class="w">   </span><span class="c1"># ignore any/all down OSDs for next hour</span></span>
</pre></div></div><p>如果触发健康检查的不健康状况恶化，大多数健康检查屏蔽会失效。
例如，假设有一个 OSD 出现故障，而它的健康检查屏蔽掉了。在这种情况下，
如果又有一个或多个 OSD 出现故障，那么这个健康屏蔽就会失效。
所有带有阈值的健康检查都会出现这种行为。</p>
</section>
</section>
<section id="id10">
<h2>检查集群的使用情况<a class="headerlink" href="#id10" title="Permalink to this heading"></a></h2>
<p>要检查集群的数据用量及其在存储池内的分布情况，可以用 <code class="docutils literal notranslate"><span class="pre">df</span></code> 选项，
它和 Linux 上的 <code class="docutils literal notranslate"><span class="pre">df</span></code> 命令相似。执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>df</span>
</pre></div></div><p><code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">df</span></code> 的输出像这样：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">CLASS</span>     <span class="n">SIZE</span>    <span class="n">AVAIL</span>     <span class="n">USED</span>  <span class="n">RAW</span> <span class="n">USED</span>  <span class="o">%</span><span class="n">RAW</span> <span class="n">USED</span>
<span class="n">ssd</span>    <span class="mi">202</span> <span class="n">GiB</span>  <span class="mi">200</span> <span class="n">GiB</span>  <span class="mf">2.0</span> <span class="n">GiB</span>   <span class="mf">2.0</span> <span class="n">GiB</span>       <span class="mf">1.00</span>
<span class="n">TOTAL</span>  <span class="mi">202</span> <span class="n">GiB</span>  <span class="mi">200</span> <span class="n">GiB</span>  <span class="mf">2.0</span> <span class="n">GiB</span>   <span class="mf">2.0</span> <span class="n">GiB</span>       <span class="mf">1.00</span>

<span class="o">---</span> <span class="n">POOLS</span> <span class="o">---</span>
<span class="n">POOL</span>                   <span class="n">ID</span>  <span class="n">PGS</span>   <span class="n">STORED</span>   <span class="p">(</span><span class="n">DATA</span><span class="p">)</span>   <span class="p">(</span><span class="n">OMAP</span><span class="p">)</span>   <span class="n">OBJECTS</span>     <span class="n">USED</span>  <span class="p">(</span><span class="n">DATA</span><span class="p">)</span>   <span class="p">(</span><span class="n">OMAP</span><span class="p">)</span>   <span class="o">%</span><span class="n">USED</span>  <span class="n">MAX</span> <span class="n">AVAIL</span>  <span class="n">QUOTA</span> <span class="n">OBJECTS</span>  <span class="n">QUOTA</span> <span class="n">BYTES</span>  <span class="n">DIRTY</span>  <span class="n">USED</span> <span class="n">COMPR</span>  <span class="n">UNDER</span> <span class="n">COMPR</span>
<span class="n">device_health_metrics</span>   <span class="mi">1</span>    <span class="mi">1</span>  <span class="mi">242</span> <span class="n">KiB</span>   <span class="mi">15</span> <span class="n">KiB</span>  <span class="mi">227</span> <span class="n">KiB</span>         <span class="mi">4</span>  <span class="mi">251</span> <span class="n">KiB</span>  <span class="mi">24</span> <span class="n">KiB</span>  <span class="mi">227</span> <span class="n">KiB</span>       <span class="mi">0</span>    <span class="mi">297</span> <span class="n">GiB</span>            <span class="n">N</span><span class="o">/</span><span class="n">A</span>          <span class="n">N</span><span class="o">/</span><span class="n">A</span>      <span class="mi">4</span>         <span class="mi">0</span> <span class="n">B</span>          <span class="mi">0</span> <span class="n">B</span>
<span class="n">cephfs</span><span class="o">.</span><span class="n">a</span><span class="o">.</span><span class="n">meta</span>           <span class="mi">2</span>   <span class="mi">32</span>  <span class="mf">6.8</span> <span class="n">KiB</span>  <span class="mf">6.8</span> <span class="n">KiB</span>      <span class="mi">0</span> <span class="n">B</span>        <span class="mi">22</span>   <span class="mi">96</span> <span class="n">KiB</span>  <span class="mi">96</span> <span class="n">KiB</span>      <span class="mi">0</span> <span class="n">B</span>       <span class="mi">0</span>    <span class="mi">297</span> <span class="n">GiB</span>            <span class="n">N</span><span class="o">/</span><span class="n">A</span>          <span class="n">N</span><span class="o">/</span><span class="n">A</span>     <span class="mi">22</span>         <span class="mi">0</span> <span class="n">B</span>          <span class="mi">0</span> <span class="n">B</span>
<span class="n">cephfs</span><span class="o">.</span><span class="n">a</span><span class="o">.</span><span class="n">data</span>           <span class="mi">3</span>   <span class="mi">32</span>      <span class="mi">0</span> <span class="n">B</span>      <span class="mi">0</span> <span class="n">B</span>      <span class="mi">0</span> <span class="n">B</span>         <span class="mi">0</span>      <span class="mi">0</span> <span class="n">B</span>     <span class="mi">0</span> <span class="n">B</span>      <span class="mi">0</span> <span class="n">B</span>       <span class="mi">0</span>     <span class="mi">99</span> <span class="n">GiB</span>            <span class="n">N</span><span class="o">/</span><span class="n">A</span>          <span class="n">N</span><span class="o">/</span><span class="n">A</span>      <span class="mi">0</span>         <span class="mi">0</span> <span class="n">B</span>          <span class="mi">0</span> <span class="n">B</span>
<span class="n">test</span>                    <span class="mi">4</span>   <span class="mi">32</span>   <span class="mi">22</span> <span class="n">MiB</span>   <span class="mi">22</span> <span class="n">MiB</span>   <span class="mi">50</span> <span class="n">KiB</span>       <span class="mi">248</span>   <span class="mi">19</span> <span class="n">MiB</span>  <span class="mi">19</span> <span class="n">MiB</span>   <span class="mi">50</span> <span class="n">KiB</span>       <span class="mi">0</span>    <span class="mi">297</span> <span class="n">GiB</span>            <span class="n">N</span><span class="o">/</span><span class="n">A</span>          <span class="n">N</span><span class="o">/</span><span class="n">A</span>    <span class="mi">248</span>         <span class="mi">0</span> <span class="n">B</span>          <span class="mi">0</span> <span class="n">B</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>CLASS:</strong> 例如， ssd 或 hdd 。</p></li>
<li><p><strong>SIZE:</strong> 集群管理着的存储容量；</p></li>
<li><p><strong>AVAIL:</strong> 集群的空闲空间总量；</p></li>
<li><p><strong>USED:</strong> 用户数据消耗的原始存储空间，包括 BlueStore 的数据库。</p></li>
<li><p><strong>RAW USED:</strong> 用户数据、内部开销、和保留容量占用的原始存储空间。</p></li>
<li><p><strong>% RAW USED:</strong> 已用原始存储空间比率。盯着这个数值，
加上 <code class="docutils literal notranslate"><span class="pre">full</span> <span class="pre">ratio</span></code> 和 <code class="docutils literal notranslate"><span class="pre">near</span> <span class="pre">full</span> <span class="pre">ratio</span></code> 来防范集群达到用满阈值。
详情见<a class="reference external" href="../../configuration/mon-config-ref#storage-capacity">存储容量</a>。</p></li>
</ul>
<p><strong>POOLS:</strong></p>
<p>输出的 <strong>POOLS</strong> 段展示了存储池列表及各存储池的<em>名义</em>使用率。本段<strong>没有</strong>展示副本、克隆品和快照占用情况。
例如，如果你把 1MB 的数据存储为对象，
那么名义使用率将是 1MB ，但考虑到副本数、克隆数、和快照数，
实际使用率可能是 2MB 或更多。</p>
<ul class="simple">
<li><p><strong>ID:</strong> 存储池内指定节点的编号。</p></li>
<li><p><strong>STORED:</strong> 用户存储在存储池中的实际数据量。
这与 Ceph 早期版本中的 USED 列类似，
但计算（对于 BlueStore ！）更精确
（因为间隙得到了正确处理）。</p>
<ul>
<li><p><strong>(DATA):</strong> RBD （RADOS 块设备）、 CephFS 文件数据、和
RGW （RADOS 网关）对象数据占用的空间。</p></li>
<li><p><strong>(OMAP):</strong> 键值对。主要是 CephFS 和 RGW （RADOS 网关）
用来存储元数据。</p></li>
</ul>
</li>
<li><p><strong>OBJECTS:</strong> 每个存储池所存储对象的名义数量
（即除副本、克隆或快照外的对象数量）。</p></li>
<li><p><strong>USED:</strong> 在所有 OSD 上为一个存储池分配的空间。
这包括复制空间、分配粒度空间以及与纠删码相关的开销空间。
压缩节省的空间和对象内容间隙也计算在内。
不过， BlueStore 的数据库不包括在
USED 项下的报告中。</p>
<ul>
<li><p><strong>(DATA):</strong> RBD （RADOS 块设备）、 CephFS 文件数据、
和 RGW （RADOS 网关）对象数据的对象使用情况。</p></li>
<li><p><strong>(OMAP):</strong> 对象的键值对。主要是 CephFS 和 RGW
（RADOS 网关）在用，用来做元数据存储。</p></li>
</ul>
</li>
<li><p><strong>%USED:</strong> 每个存储池已用存储空间的名义百分比。</p></li>
<li><p><strong>MAX AVAIL:</strong> 可写入此存储池的名义数据量的估计值。</p></li>
<li><p><strong>QUOTA OBJECTS:</strong> 配额对象的数量。</p></li>
<li><p><strong>QUOTA BYTES:</strong> 配额对象的字节数。</p></li>
<li><p><strong>DIRTY:</strong> 缓存池中已写入缓存池但尚未刷回到后端存储池的对象数量。
此字段仅在使用分级缓存时可用。</p></li>
<li><p><strong>USED COMPR:</strong> 为压缩数据分配的空间大小。
除了已压缩的数据，还包括复制、分配粒度和纠删码开销所需的所有空间。</p></li>
<li><p><strong>UNDER COMPR:</strong> 压缩过的（所有副本的总和）、
以及值得以压缩形式存储的数据量。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>POOLS 段内的数值是名义上的，
它们不包含副本、克隆、或快照。因此，
输出里 POOLS 段中的 USED 和 %USED 数量之和不会等于
RAW 段中的 USED 和 USED 数量之和。</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>MAX AVAIL 数值是个复杂的函数，
取决于所用的是多副本还是纠删码、
映射存储与设备的 CRUSH 规则、那些设备的利用率、还有配置的 <code class="docutils literal notranslate"><span class="pre">mon_osd_full_ratio</span></code> 选项。</p>
</div>
</section>
<section id="osd">
<h2>检查 OSD 状态<a class="headerlink" href="#osd" title="Permalink to this heading"></a></h2>
<p>要确定 OSD 状态是否为 <code class="docutils literal notranslate"><span class="pre">up</span></code> 且 <code class="docutils literal notranslate"><span class="pre">in</span></code> ，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt3:before {
  content: "# ";
}
</style><span class="prompt3">ceph<span class="w"> </span>osd<span class="w"> </span>stat</span>
</pre></div></div><p>或者，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt3">ceph<span class="w"> </span>osd<span class="w"> </span>dump</span>
</pre></div></div><p>根据 OSD 在 CRUSH 图里的位置来查看，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt3">ceph<span class="w"> </span>osd<span class="w"> </span>tree</span>
</pre></div></div><p>打印出 CRUSH 树，显示主机、及其内的 OSD ， OSD 状态是否为 <code class="docutils literal notranslate"><span class="pre">up</span></code> 、
还有 OSD 的权重，执行下列命令：</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="c1">#ID CLASS WEIGHT  TYPE NAME             STATUS REWEIGHT PRI-AFF</span>
<span class="w"> </span>-1<span class="w">       </span><span class="m">3</span>.00000<span class="w"> </span>pool<span class="w"> </span>default
<span class="w"> </span>-3<span class="w">       </span><span class="m">3</span>.00000<span class="w"> </span>rack<span class="w"> </span>mainrack
<span class="w"> </span>-2<span class="w">       </span><span class="m">3</span>.00000<span class="w"> </span>host<span class="w"> </span>osd-host
<span class="w">  </span><span class="m">0</span><span class="w">   </span>ssd<span class="w"> </span><span class="m">1</span>.00000<span class="w">         </span>osd.0<span class="w">             </span>up<span class="w">  </span><span class="m">1</span>.00000<span class="w"> </span><span class="m">1</span>.00000
<span class="w">  </span><span class="m">1</span><span class="w">   </span>ssd<span class="w"> </span><span class="m">1</span>.00000<span class="w">         </span>osd.1<span class="w">             </span>up<span class="w">  </span><span class="m">1</span>.00000<span class="w"> </span><span class="m">1</span>.00000
<span class="w">  </span><span class="m">2</span><span class="w">   </span>ssd<span class="w"> </span><span class="m">1</span>.00000<span class="w">         </span>osd.2<span class="w">             </span>up<span class="w">  </span><span class="m">1</span>.00000<span class="w"> </span><span class="m">1</span>.00000
</pre></div>
</div>
<p>个中详情见<a class="reference external" href="../monitoring-osd-pg">监控 OSD 和归置组</a>。</p>
</section>
<section id="id11">
<h2>检查监视器状态<a class="headerlink" href="#id11" title="Permalink to this heading"></a></h2>
<p>如果你的集群有多个监视器，则需要执行某些“监视器状态”（ monitor status ）检查。
在启动集群后、读写数据前，应该检查法定人数状态。
运行着多个监视器时必须形成法定人数，才能保证集群是正常运行的。
最好周期性地检查监视器状态来确定它们在运行。</p>
<p id="display-mon-map">要查看监视器图，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>mon<span class="w"> </span>stat</span>
</pre></div></div><p>或者，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>mon<span class="w"> </span>dump</span>
</pre></div></div><p>要检查监视器集群的法定人数状态，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>quorum_status</span>
</pre></div></div><p>Ceph 会返回法定人数状态，例如，包含 3 个监视器的 Ceph 集群可能返回下面的：</p>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="w"> </span><span class="s2">&quot;election_epoch&quot;</span><span class="o">:</span><span class="w"> </span><span class="mf">10</span><span class="p">,</span>
<span class="w">  </span><span class="s2">&quot;quorum&quot;</span><span class="o">:</span><span class="w"> </span><span class="p">[</span>
<span class="w">        </span><span class="mf">0</span><span class="p">,</span>
<span class="w">        </span><span class="mf">1</span><span class="p">,</span>
<span class="w">        </span><span class="mf">2</span><span class="p">],</span>
<span class="w">  </span><span class="s2">&quot;quorum_names&quot;</span><span class="o">:</span><span class="w"> </span><span class="p">[</span>
<span class="w">        </span><span class="s2">&quot;a&quot;</span><span class="p">,</span>
<span class="w">        </span><span class="s2">&quot;b&quot;</span><span class="p">,</span>
<span class="w">        </span><span class="s2">&quot;c&quot;</span><span class="p">],</span>
<span class="w">  </span><span class="s2">&quot;quorum_leader_name&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;a&quot;</span><span class="p">,</span>
<span class="w">  </span><span class="s2">&quot;monmap&quot;</span><span class="o">:</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="s2">&quot;epoch&quot;</span><span class="o">:</span><span class="w"> </span><span class="mf">1</span><span class="p">,</span>
<span class="w">      </span><span class="s2">&quot;fsid&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;444b489c-4f16-4b75-83f0-cb8097468898&quot;</span><span class="p">,</span>
<span class="w">      </span><span class="s2">&quot;modified&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;2011-12-12 13:28:27.505520&quot;</span><span class="p">,</span>
<span class="w">      </span><span class="s2">&quot;created&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;2011-12-12 13:28:27.505520&quot;</span><span class="p">,</span>
<span class="w">      </span><span class="s2">&quot;features&quot;</span><span class="o">:</span><span class="w"> </span><span class="p">{</span><span class="s2">&quot;persistent&quot;</span><span class="o">:</span><span class="w"> </span><span class="p">[</span>
<span class="w">                        </span><span class="s2">&quot;kraken&quot;</span><span class="p">,</span>
<span class="w">                        </span><span class="s2">&quot;luminous&quot;</span><span class="p">,</span>
<span class="w">                        </span><span class="s2">&quot;mimic&quot;</span><span class="p">],</span>
<span class="w">        </span><span class="s2">&quot;optional&quot;</span><span class="o">:</span><span class="w"> </span><span class="p">[]</span>
<span class="w">      </span><span class="p">},</span>
<span class="w">      </span><span class="s2">&quot;mons&quot;</span><span class="o">:</span><span class="w"> </span><span class="p">[</span>
<span class="w">            </span><span class="p">{</span><span class="w"> </span><span class="s2">&quot;rank&quot;</span><span class="o">:</span><span class="w"> </span><span class="mf">0</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;name&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;a&quot;</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;addr&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1:6789/0&quot;</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;public_addr&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1:6789/0&quot;</span><span class="p">},</span>
<span class="w">            </span><span class="p">{</span><span class="w"> </span><span class="s2">&quot;rank&quot;</span><span class="o">:</span><span class="w"> </span><span class="mf">1</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;name&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;b&quot;</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;addr&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1:6790/0&quot;</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;public_addr&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1:6790/0&quot;</span><span class="p">},</span>
<span class="w">            </span><span class="p">{</span><span class="w"> </span><span class="s2">&quot;rank&quot;</span><span class="o">:</span><span class="w"> </span><span class="mf">2</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;name&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;c&quot;</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;addr&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1:6791/0&quot;</span><span class="p">,</span>
<span class="w">              </span><span class="s2">&quot;public_addr&quot;</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;127.0.0.1:6791/0&quot;</span><span class="p">}</span>
<span class="w">           </span><span class="p">]</span>
<span class="w">  </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</section>
<section id="mds">
<h2>检查 MDS 状态<a class="headerlink" href="#mds" title="Permalink to this heading"></a></h2>
<p>元数据服务器为 CephFS 提供元数据服务。元数据服务器有两组状态： <code class="docutils literal notranslate"><span class="pre">up</span> <span class="pre">|</span> <span class="pre">down</span></code> 和 <code class="docutils literal notranslate"><span class="pre">active</span> <span class="pre">|</span> <span class="pre">inactive</span></code> 。
要查看元数据服务器状态为 <code class="docutils literal notranslate"><span class="pre">up</span></code> 且 <code class="docutils literal notranslate"><span class="pre">active</span></code> ，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>mds<span class="w"> </span>stat</span>
</pre></div></div><p>要展示元数据服务器们的详细状态，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>fs<span class="w"> </span>dump</span>
</pre></div></div></section>
<section id="id12">
<h2>检查归置组状态<a class="headerlink" href="#id12" title="Permalink to this heading"></a></h2>
<p>归置组（ PG ）把对象映射到 OSD 。归置组处于监控下，以确保它们的状态是
<code class="docutils literal notranslate"><span class="pre">active</span></code> 且 <code class="docutils literal notranslate"><span class="pre">clean</span></code> 。参见<a class="reference external" href="../monitoring-osd-pg">监控 OSD 和归置组</a>。</p>
</section>
<section id="rados-monitoring-using-admin-socket">
<span id="id14"></span><h2>使用管理套接字<a class="headerlink" href="#rados-monitoring-using-admin-socket" title="Permalink to this heading"></a></h2>
<p>Ceph 管理套接字允许你通过套接字接口查询守护进程，
它们默认存在于 <code class="docutils literal notranslate"><span class="pre">/var/run/ceph</span></code> 下。
要通过管理套接字访问某个守护进程，先登录它所在的主机、再执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>daemon<span class="w"> </span><span class="o">{</span>daemon-name<span class="o">}</span></span>
<span class="prompt1">ceph<span class="w"> </span>daemon<span class="w"> </span><span class="o">{</span>path-to-socket-file<span class="o">}</span></span>
</pre></div></div><p>比如，这是下面这两种用法是等价的：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>daemon<span class="w"> </span>osd.0<span class="w"> </span>foo</span>
<span class="prompt1">ceph<span class="w"> </span>daemon<span class="w"> </span>/var/run/ceph/ceph-osd.0.asok<span class="w"> </span>foo</span>
</pre></div></div><p>运行管理员套接字命令有两种方法：(1) 如上所述，用 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">daemon</span></code> ，
这种方法绕过了监视器，假定已经直接登录守护进程所在主机；
(2) 用 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">tell</span> <span class="pre">{daemon-type}.{id}</span></code> 命令，这种方法由监视器转发，
不需要访问那个守护进程所在的主机。</p>
<p>用 <code class="docutils literal notranslate"><span class="pre">raise</span></code> 命令向守护进程发送信号，效果和运行 <code class="docutils literal notranslate"><span class="pre">kill</span> <span class="pre">-X</span> <span class="pre">{daemon.pid}</span></code> 命令一样。
通过 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">tell</span></code> 执行命令时，可以向守护进程发送信号，而无需访问其主机：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>daemon<span class="w"> </span><span class="o">{</span>daemon-name<span class="o">}</span><span class="w"> </span>raise<span class="w"> </span>HUP</span>
<span class="prompt1">ceph<span class="w"> </span>tell<span class="w"> </span><span class="o">{</span>daemon-type<span class="o">}</span>.<span class="o">{</span>id<span class="o">}</span><span class="w"> </span>raise<span class="w"> </span>-9</span>
</pre></div></div><p>查看可用的管理套接字命令，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph<span class="w"> </span>daemon<span class="w"> </span><span class="o">{</span>daemon-name<span class="o">}</span><span class="w"> </span><span class="nb">help</span></span>
</pre></div></div><p>管理套接字命令允许你在运行时查看和修改配置。
关于查看配置信息的更多内容，见<a class="reference external" href="../../configuration/ceph-conf#viewing-a-configuration-at-runtime">查看运行时配置</a>。</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../health-checks/" class="btn btn-neutral float-left" title="健康检查" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../monitoring-osd-pg/" class="btn btn-neutral float-right" title="监控 OSD 和归置组" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>